import matplotlib.pyplot as plt
import numpy as np
def show_error(a,n,show=True):
    if a[:2]!=n[:2]:
        raise ValueError('形状不匹配')
    MSE=np.mean((a[1]-n[1])**2)
    fig,axs=plt.subplots(1,3)
    s1=axs[0].scatter(a[0],a[1],c=n[2],cmap='jet',s=1)
    fig.colorbar(s1,ax=axs[0])
    s2=axs[1].scatter(a[0],a[1],c=a[2],cmap='jet',s=1)
    fig.colorbar(s2,ax=axs[1])
    s3=axs[2].scatter(a[0],a[1],c=n[2]-a[2],cmap='jet',s=1)
    fig.colorbar(s3,ax=axs[2])
    for i in axs:
        i.autoscale(enable=True, axis='both', tight=True)
        i.set_xlabel('x')
        i.set_ylabel('t')
    if show:
        print(MSE)
        plt.show()
    return MSE,fig